3.164 \(\int \csc ^4(e+f x) (a+b \sin (e+f x))^2 \, dx\)

Optimal. Leaf size=82 \[ -\frac {\left (2 a^2+3 b^2\right ) \cot (e+f x)}{3 f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f} \]

[Out]

-a*b*arctanh(cos(f*x+e))/f-1/3*(2*a^2+3*b^2)*cot(f*x+e)/f-a*b*cot(f*x+e)*csc(f*x+e)/f-1/3*a^2*cot(f*x+e)*csc(f
*x+e)^2/f

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2789, 3768, 3770, 3012, 3767, 8} \[ -\frac {\left (2 a^2+3 b^2\right ) \cot (e+f x)}{3 f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^4*(a + b*Sin[e + f*x])^2,x]

[Out]

-((a*b*ArcTanh[Cos[e + f*x]])/f) - ((2*a^2 + 3*b^2)*Cot[e + f*x])/(3*f) - (a*b*Cot[e + f*x]*Csc[e + f*x])/f -
(a^2*Cot[e + f*x]*Csc[e + f*x]^2)/(3*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2789

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Dist[(2*c*d)/b
, Int[(b*Sin[e + f*x])^(m + 1), x], x] + Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c,
 d, e, f, m}, x]

Rule 3012

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*Cos[e
+ f*x]*(b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3768

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Csc[c + d*x])^(n - 1))/(d*(n -
 1)), x] + Dist[(b^2*(n - 2))/(n - 1), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1
] && IntegerQ[2*n]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc ^4(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \csc ^3(e+f x) \, dx+\int \csc ^4(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {a b \cot (e+f x) \csc (e+f x)}{f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}+(a b) \int \csc (e+f x) \, dx+\frac {1}{3} \left (2 a^2+3 b^2\right ) \int \csc ^2(e+f x) \, dx\\ &=-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {\left (2 a^2+3 b^2\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (e+f x))}{3 f}\\ &=-\frac {a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {\left (2 a^2+3 b^2\right ) \cot (e+f x)}{3 f}-\frac {a b \cot (e+f x) \csc (e+f x)}{f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 132, normalized size = 1.61 \[ -\frac {2 a^2 \cot (e+f x)}{3 f}-\frac {a^2 \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {a b \csc ^2\left (\frac {1}{2} (e+f x)\right )}{4 f}+\frac {a b \sec ^2\left (\frac {1}{2} (e+f x)\right )}{4 f}+\frac {a b \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}-\frac {a b \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f}-\frac {b^2 \cot (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^4*(a + b*Sin[e + f*x])^2,x]

[Out]

(-2*a^2*Cot[e + f*x])/(3*f) - (b^2*Cot[e + f*x])/f - (a*b*Csc[(e + f*x)/2]^2)/(4*f) - (a^2*Cot[e + f*x]*Csc[e
+ f*x]^2)/(3*f) - (a*b*Log[Cos[(e + f*x)/2]])/f + (a*b*Log[Sin[(e + f*x)/2]])/f + (a*b*Sec[(e + f*x)/2]^2)/(4*
f)

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 149, normalized size = 1.82 \[ -\frac {2 \, {\left (2 \, a^{2} + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{3} - 6 \, a b \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, {\left (a b \cos \left (f x + e\right )^{2} - a b\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - 3 \, {\left (a b \cos \left (f x + e\right )^{2} - a b\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - 6 \, {\left (a^{2} + b^{2}\right )} \cos \left (f x + e\right )}{6 \, {\left (f \cos \left (f x + e\right )^{2} - f\right )} \sin \left (f x + e\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

-1/6*(2*(2*a^2 + 3*b^2)*cos(f*x + e)^3 - 6*a*b*cos(f*x + e)*sin(f*x + e) + 3*(a*b*cos(f*x + e)^2 - a*b)*log(1/
2*cos(f*x + e) + 1/2)*sin(f*x + e) - 3*(a*b*cos(f*x + e)^2 - a*b)*log(-1/2*cos(f*x + e) + 1/2)*sin(f*x + e) -
6*(a^2 + b^2)*cos(f*x + e))/((f*cos(f*x + e)^2 - f)*sin(f*x + e))

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*sin(f*x+e))^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)2/f*((256/3*tan((f*x+exp(1))/2)^3*a^2+512*tan((f*x+exp(1))/2)^2*b*a+1024*tan((f*x+exp(1))/2)*b^2+768*tan((
f*x+exp(1))/2)*a^2)/4096+(-44*tan((f*x+exp(1))/2)^3*b*a-12*tan((f*x+exp(1))/2)^2*b^2-9*tan((f*x+exp(1))/2)^2*a
^2-6*tan((f*x+exp(1))/2)*b*a-a^2)*1/48/tan((f*x+exp(1))/2)^3+b*a/2*ln(abs(tan((f*x+exp(1))/2))))

________________________________________________________________________________________

maple [A]  time = 0.40, size = 93, normalized size = 1.13 \[ -\frac {2 a^{2} \cot \left (f x +e \right )}{3 f}-\frac {a^{2} \cot \left (f x +e \right ) \left (\csc ^{2}\left (f x +e \right )\right )}{3 f}-\frac {a b \cot \left (f x +e \right ) \csc \left (f x +e \right )}{f}+\frac {a b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f}-\frac {b^{2} \cot \left (f x +e \right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^4*(a+b*sin(f*x+e))^2,x)

[Out]

-2/3*a^2*cot(f*x+e)/f-1/3*a^2*cot(f*x+e)*csc(f*x+e)^2/f-a*b*cot(f*x+e)*csc(f*x+e)/f+1/f*a*b*ln(csc(f*x+e)-cot(
f*x+e))-1/f*b^2*cot(f*x+e)

________________________________________________________________________________________

maxima [A]  time = 0.69, size = 89, normalized size = 1.09 \[ \frac {3 \, a b {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {6 \, b^{2}}{\tan \left (f x + e\right )} - \frac {2 \, {\left (3 \, \tan \left (f x + e\right )^{2} + 1\right )} a^{2}}{\tan \left (f x + e\right )^{3}}}{6 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/6*(3*a*b*(2*cos(f*x + e)/(cos(f*x + e)^2 - 1) - log(cos(f*x + e) + 1) + log(cos(f*x + e) - 1)) - 6*b^2/tan(f
*x + e) - 2*(3*tan(f*x + e)^2 + 1)*a^2/tan(f*x + e)^3)/f

________________________________________________________________________________________

mupad [B]  time = 6.78, size = 136, normalized size = 1.66 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{24\,f}+\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (\frac {3\,a^2}{8}+\frac {b^2}{2}\right )}{f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (3\,a^2+4\,b^2\right )+\frac {a^2}{3}+2\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{8\,f}+\frac {a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{4\,f}+\frac {a\,b\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(e + f*x))^2/sin(e + f*x)^4,x)

[Out]

(a^2*tan(e/2 + (f*x)/2)^3)/(24*f) + (tan(e/2 + (f*x)/2)*((3*a^2)/8 + b^2/2))/f - (cot(e/2 + (f*x)/2)^3*(tan(e/
2 + (f*x)/2)^2*(3*a^2 + 4*b^2) + a^2/3 + 2*a*b*tan(e/2 + (f*x)/2)))/(8*f) + (a*b*tan(e/2 + (f*x)/2)^2)/(4*f) +
 (a*b*log(tan(e/2 + (f*x)/2)))/f

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (e + f x \right )}\right )^{2} \csc ^{4}{\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**4*(a+b*sin(f*x+e))**2,x)

[Out]

Integral((a + b*sin(e + f*x))**2*csc(e + f*x)**4, x)

________________________________________________________________________________________